<template>
<div>
  <h1>{{ title }}</h1>
  <p>count:{{ count }}</p>
  <p>用户名: {{ user.name }}</p>
  <p>年龄：{{ user.age }}</p>
  <p v-for="item in scores" :key="item">{{ item }}</p>
</div>
</template>

<script setup>
const props = defineProps({
    title:{
       type:String,
       //required:true,
    },
    count:{
        type:Number,
        dafault:0,//应用组件不传值的情况下默认值
    },
    user:{
        type:Object,
        dafault:()=>({
            name:"默认用户",
            age:18,
        }),
        // required:true,
    },
    scores:{
        type:Array,
        dafault:() => [],
    },
});
</script>

<style>

</style>